<!DOCTYPE html>
<html>
  <head>
    <title>Email Validation</title>
    <link href="css/styles.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

  </head>
  <body>

    <div id="container">

      <!--content-->
      <div class="success" style="display: none;">Your email address has been verified.<br><br><br></div>

      <div class="error" style="display: none;">Error verifying your email address.
      <br><br><br><button class="small_button" onclick="window.location='/request_email.html'">Resend verification token.</button></div>


        <div class="expired" style="display: none;">Your verification link has expired.<br><br><br><button class="small_button" onclick="window.location='/request_email.html'">Resend verification token.</button></div>



    </div>


    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/store.js"></script>
    <script src="js/oauth2.js"></script>
    <script src="js/verify.js"></script>
    <script type="text/javascript">

    $(document).ready(function () {
      oauth2.verify.verify(window.location.search.substring(1), function (error){
        if (!error)
          $('.success').show()
        else if (error.status == '409') // already verified
          $('.success').show()
        else if (error.status == '404')
          $('.error').show()
        else if (error.status == '400')
          $('.expired').show()
        else
          $('.error').show()
      })
    })
    </script>
  </body>
</html>